//----------------------------------------------------------------------------
// M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S
//----------------------------------------------------------------------------
// Copyright (C) 2011 - MARIN - All rights reserved - http://www.marin.nl
//----------------------------------------------------------------------------
// Program    : mermaid
// Module     : vbm
// File       : CudaIpDiagSolver.h
//----------------------------------------------------------------------------

#ifndef CUDAIPDIAGSOLVER_H
#define CUDAIPDIAGSOLVER_H

#include "defines.h"
#include "Solver.h"
#include "Array2D.h"
#include "CUDAPACKAGE/ipdiagsolver/CG.h"

#define CudaIpDiagSolver_BASE Solver

/// conjugate gradient solver
class CudaIpDiagSolver : public CudaIpDiagSolver_BASE
{
    typedef CudaIpDiagSolver_BASE base;

public:

    CudaIpDiagSolver(Array2D<REAL> *pmatC,
               Array2D<REAL> *pmatS,
               Array2D<REAL> *pmatW,
               int N,
               int M,
               REAL tolerance);

    virtual ~CudaIpDiagSolver();

    virtual void solve(Array2D<REAL> *pB,
                       Array2D<REAL> *pX);

private:

    /// @cond nevercall
    CudaIpDiagSolver(const CudaIpDiagSolver& m);
    CudaIpDiagSolver & operator =(const CudaIpDiagSolver& m);
    /// @endcond
};

#endif // CUDAIPDIAGSOLVER_H
